QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Boxes

Figure 9 shows a box.

Figure 9 A box

Labels

ASCII
Box
Binary
box ( = 0x626F7820 )

Data Format

Vector3D            orientation
Vector3D            majorAxis
Vector3D            minorAxis
Point3D             origin
orientation
The orientation of the box.
majorAxis
The major axis of the box.
minorAxis
The minor axis of the box.
origin
The origin of the box.

Data Size

0 or 48

Description

A box is a three-dimensional object defined by an origin (that is, a corner of the box) and three vectors that define the edges of the box that meet in that corner. A box may be used to model a cube, rectangular prism, or other parallelipiped. Attributes may be applied to each of the six faces of a box and to the entire geometry of the box.

Default Surface Parameterization

The default surface parameterization for a box is as shown in Figure 10 .

Figure 10 The default surface parameterization of a box

Parent Hierarchy

Shared, shape, geometry.

Parent Objects

None.

Child Objects

Face attribute set list (optional), attribute set (optional). For the purpose of attribute assignment, the faces of a box are indexed as follows:

0
The face perpendicular to the orientation vector having the endpoint of the orientation vector as one of its vertices. In Figure 10 , this is the top face of the box.
1
The face perpendicular to the orientation vector having the origin as one of its vertices. In Figure 10 , this is the bottom face of the box.
2
The face perpendicular to the major axis having the endpoint of the major axis as one of its vertices. In Figure 10 , this is the front face of the box.
3
The face perpendicular to the major axis having the origin as one of its vertices. In Figure 10 , this is the back face of the box.
4
The face perpendicular to the minor axis having the endpoint of the minor axis as one of its vertices. In Figure 10 , this is the right face of the box.
5
The face perpendicular to the minor axis having the origin as one of its vertices. In Figure 10 , this is the front face of the box.

Example

Container (
    Box ( ... )
    Container (
        FaceAttributeSetList (6 Exclude 2 1 4)

        Container (
            AttributeSet ( )                    #left face
            DiffuseColor ( 1 0 0 )
        )
        Container (
            AttributeSet ( )                    #bottom face
            DiffuseColor ( 0 1 1 )
        )
        Container (
            AttributeSet ( )                    #top face
            DiffuseColor ( 0 1 0 )
        )
        Container (
            AttributeSet ( )                    #front face
            DiffuseColor ( 1 0 1 )
        )
    )
    Container (
        AttributeSet ( )
        DiffuseColor(0 0 0)
    )
)

Default Size

For objects of size 0, the default is

1 0 0 0 1 0 0 0 1 0 0 0


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |